﻿using System;
using UnityEngine;

namespace ParticlePlayground
{
	// Token: 0x02000135 RID: 309
	public class SwitchMultithreading : MonoBehaviour
	{
		// Token: 0x06000666 RID: 1638 RVA: 0x0002609C File Offset: 0x0002429C
		public static void NextParticleSystemMethod()
		{
			switch (PlaygroundC.reference.threadMethod)
			{
			case ThreadMethod.NoThreads:
				PlaygroundC.reference.threadMethod = ThreadMethod.OnePerSystem;
				break;
			case ThreadMethod.OnePerSystem:
				PlaygroundC.reference.threadMethod = ThreadMethod.OneForAll;
				break;
			case ThreadMethod.OneForAll:
				PlaygroundC.reference.threadMethod = ThreadMethod.Automatic;
				break;
			case ThreadMethod.Automatic:
				PlaygroundC.reference.threadMethod = ThreadMethod.NoThreads;
				break;
			}
		}

		// Token: 0x06000667 RID: 1639 RVA: 0x00026110 File Offset: 0x00024310
		public static void NextSkinnedMeshMethod()
		{
			switch (PlaygroundC.reference.skinnedMeshThreadMethod)
			{
			case ThreadMethodComponent.InsideParticleCalculation:
				PlaygroundC.reference.skinnedMeshThreadMethod = ThreadMethodComponent.OnePerSystem;
				break;
			case ThreadMethodComponent.OnePerSystem:
				PlaygroundC.reference.skinnedMeshThreadMethod = ThreadMethodComponent.OneForAll;
				break;
			case ThreadMethodComponent.OneForAll:
				PlaygroundC.reference.skinnedMeshThreadMethod = ThreadMethodComponent.InsideParticleCalculation;
				break;
			}
		}

		// Token: 0x06000668 RID: 1640 RVA: 0x00026170 File Offset: 0x00024370
		public static void NextTurbulenceMethod()
		{
			switch (PlaygroundC.reference.turbulenceThreadMethod)
			{
			case ThreadMethodComponent.InsideParticleCalculation:
				PlaygroundC.reference.turbulenceThreadMethod = ThreadMethodComponent.OnePerSystem;
				break;
			case ThreadMethodComponent.OnePerSystem:
				PlaygroundC.reference.turbulenceThreadMethod = ThreadMethodComponent.OneForAll;
				break;
			case ThreadMethodComponent.OneForAll:
				PlaygroundC.reference.turbulenceThreadMethod = ThreadMethodComponent.InsideParticleCalculation;
				break;
			}
		}

		// Token: 0x06000669 RID: 1641 RVA: 0x000261D0 File Offset: 0x000243D0
		public static void NextThreadPoolMethod()
		{
			ThreadPoolMethod threadPoolMethod = PlaygroundC.reference.threadPoolMethod;
			if (threadPoolMethod != ThreadPoolMethod.ThreadPool)
			{
				if (threadPoolMethod == ThreadPoolMethod.PlaygroundPool)
				{
					PlaygroundC.reference.threadPoolMethod = ThreadPoolMethod.ThreadPool;
				}
			}
			else
			{
				PlaygroundC.reference.threadPoolMethod = ThreadPoolMethod.PlaygroundPool;
			}
		}

		// Token: 0x0600066A RID: 1642 RVA: 0x0002621C File Offset: 0x0002441C
		public static void NextIndividualParticleSystemMethod(PlaygroundParticlesC p)
		{
			switch (p.threadMethod)
			{
			case ThreadMethodLocal.Inherit:
				p.threadMethod = ThreadMethodLocal.OnePerSystem;
				break;
			case ThreadMethodLocal.OnePerSystem:
				p.threadMethod = ThreadMethodLocal.OneForAll;
				break;
			case ThreadMethodLocal.OneForAll:
				p.threadMethod = ThreadMethodLocal.Inherit;
				break;
			}
		}
	}
}
